home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / NDK / NDK_3.5 / Include / include_i / devices / prtbase.i < prev    next >
Encoding:
Text File  |  1999-10-30  |  7.6 KB  |  222 lines

  1.    IFND  DEVICES_PRTBASE_I
  2. DEVICES_PRTBASE_I EQU    1
  3. **
  4. **    $VER: prtbase.i 44.1 (19.10.1999)
  5. **    Includes Release 44.1
  6. **
  7. **    printer.device base structure definitions
  8. **
  9. **    (C) Copyright 1987-1999 Amiga, Inc.
  10. **        All Rights Reserved
  11. **
  12.  
  13.    IFND  EXEC_TYPES_I
  14.    INCLUDE  "exec/types.i"
  15.    ENDC
  16.    IFND  EXEC_NODES_I
  17.    INCLUDE  "exec/nodes.i"
  18.    ENDC
  19.    IFND  EXEC_LISTS_I
  20.    INCLUDE  "exec/lists.i"
  21.    ENDC
  22.    IFND  EXEC_PORTS_I
  23.    INCLUDE  "exec/ports.i"
  24.    ENDC
  25.    IFND  EXEC_LIBRARIES_I
  26.    INCLUDE  "exec/libraries.i"
  27.    ENDC
  28.    IFND  EXEC_TASKS_I
  29.    INCLUDE  "exec/tasks.i"
  30.    ENDC
  31.  
  32.    IFND  DEVICES_PARALLEL_I
  33.    INCLUDE  "devices/parallel.i"
  34.    ENDC
  35.    IFND  DEVICES_SERIAL_I
  36.    INCLUDE  "devices/serial.i"
  37.    ENDC
  38.    IFND  DEVICES_TIMER_I
  39.    INCLUDE  "devices/timer.i"
  40.    ENDC
  41.    IFND  LIBRARIES_DOSEXTENS_I
  42.    INCLUDE  "libraries/dosextens.i"
  43.    ENDC
  44.    IFND  INTUITION_INTUITION_I
  45.    INCLUDE  "intuition/intuition.i"
  46.    ENDC
  47.  
  48.  
  49.  STRUCTURE  DeviceData,LIB_SIZE
  50.     APTR dd_Segment          ; A0 when initialized
  51.     APTR dd_ExecBase          ; A6 for exec
  52.     APTR dd_CmdVectors          ; command table for device commands
  53.     APTR dd_CmdBytes          ; bytes describing which command queue
  54.     UWORD   dd_NumCommands    ; the number of commands supported
  55.     LABEL   dd_SIZEOF
  56.  
  57.  
  58. *------
  59. *------ device driver private variables ------------------------------
  60. *------
  61. du_Flags EQU   LN_PRI          ; various unit flags
  62.  
  63. ;------ IO_FLAGS
  64.     BITDEF  IO,QUEUED,4       ; command is queued to be performed
  65.     BITDEF  IO,CURRENT,5      ; command is being performed
  66.     BITDEF  IO,SERVICING,6    ; command is being actively performed
  67.     BITDEF  IO,DONE,7          ; command is done
  68.  
  69. ;------ du_Flags
  70.     BITDEF  DU,STOPPED,0      ; commands are not to be performed
  71.  
  72.  
  73. *------ Constants ----------------------------------------------------
  74. P_PRIORITY    EQU    0
  75. P_OLDSTKSIZE    EQU    $0800    ; stack size for child task (OBSOLETE)
  76. P_STKSIZE    EQU    $1000    ; stack size for child task
  77. P_BUFSIZE    EQU    256    ; size of internal buffers for text i/o
  78. P_SAFESIZE    EQU    128    ; safety margin for text output buffer
  79.  
  80. *------ pd_Flags ------
  81.    BITDEF   P,IOR0,0          ; IOR0 is in use
  82.    BITDEF   P,IOR1,1          ; IOR1 is in use
  83.    BITDEF   P,IOOPENED,2      ; PRIVATE
  84.    BITDEF   P,EXPUNGED,7      ; device to be expunged when all closed
  85.  
  86.  STRUCTURE  PrinterData,dd_SIZEOF
  87.     STRUCT  pd_Unit,MP_SIZE   ; the one and only unit
  88.     BPTR pd_PrinterSegment    ; the printer specific segment
  89.     UWORD   pd_PrinterType    ; the segment printer type
  90.     APTR pd_SegmentData       ; the segment data structure
  91.     APTR pd_PrintBuf          ; the raster print buffer
  92.     APTR pd_PWrite          ; the parallel write function
  93.     APTR pd_PBothReady          ; the parallel write function's done
  94.  
  95.     IFGT IOEXTPar_SIZE-IOEXTSER_SIZE
  96.     STRUCT  pd_IOR0,IOEXTPar_SIZE   ; port I/O request 0
  97.     STRUCT  pd_IOR1,IOEXTPar_SIZE   ;   and 1 for double buffering
  98.     ENDC
  99.  
  100.     IFLE IOEXTPar_SIZE-IOEXTSER_SIZE
  101.     STRUCT  pd_IOR0,IOEXTSER_SIZE   ; port I/O request 0
  102.     STRUCT  pd_IOR1,IOEXTSER_SIZE   ;   and 1 for double buffering
  103.     ENDC
  104.  
  105.     STRUCT  pd_TIOR,IOTV_SIZE       ; timer I/O request
  106.     STRUCT  pd_IORPort,MP_SIZE      ;   and message reply port
  107.     STRUCT  pd_TC,TC_SIZE           ; write task
  108.     STRUCT  pd_OldStk,P_OLDSTKSIZE  ;   and stack space (OBSOLETE)
  109.     UBYTE   pd_Flags                ; device flags
  110.     UBYTE   pd_pad            ; padding
  111.     STRUCT  pd_Preferences,pf_SIZEOF ; the latest preferences
  112.     UBYTE   pd_PWaitEnabled         ; wait function switch
  113. ;   /* new fields for V2.0 */
  114.     UBYTE   pd_Pad1            ; padding
  115.     STRUCT  pd_Stk,P_STKSIZE        ; stack space
  116. ;   new fields for V3.5 (V44)
  117.     APTR    pd_PUnit
  118.     APTR    pd_PRead
  119.     APTR    pd_CallErrHook
  120.     ULONG   pd_UnitNumber
  121.     APTR    pd_DriverName
  122.     APTR    pd_PQuery
  123.     LABEL   pd_SIZEOF               ; warning! this may be odd
  124.  
  125.     BITDEF  PPC,GFX,0        ;graphics (bit position)
  126.     BITDEF  PPC,COLOR,1        ;color (bit position)
  127.     BITDEF  PPC,EXTENDED,2      ;extended
  128.     BITDEF  PPC,NOSTRIP,3    ;no strip printing
  129.  
  130. PPC_BWALPHA    EQU    $00    ;black&white alphanumerics
  131. PPC_BWGFX    EQU    $01    ;black&white graphics
  132. PPC_COLORALPHA    EQU    $02    ;color alphanumerics
  133. PPC_COLORGFX    EQU    $03    ;color graphics
  134.  
  135. PCC_BW        EQU    1    ;black&white only
  136. PCC_YMC        EQU    2    ;yellow/magenta/cyan only
  137. PCC_YMC_BW    EQU    3    ;yellow/magenta/cyan or black&white
  138. PCC_YMCB    EQU    4    ;yellow/magenta/cyan/black
  139.  
  140. PCC_4COLOR    EQU    $4    ;a flag for YMCB and BGRW
  141. PCC_ADDITIVE    EQU    $8    ;not ymcb but blue/green/red/white
  142. PCC_WB        EQU    $9    ;black&white only, 0 == BLACK
  143. PCC_BGR        EQU    $a    ;blue/green/red
  144. PCC_BGR_WB    EQU    $b    ;blue/green/red or black&white
  145. PCC_BGRW    EQU    $c    ;blue/green/red/white
  146. ;    The picture must be scanned once for each color component, as the
  147. ;    printer can only define one color at a time.  ie. If 'PCC_YMC' then
  148. ;    first pass sends all 'Y' info to printer, second pass sends all 'M'
  149. ;    info, and third pass sends all C info to printer.  The CalComp
  150. ;    PlotMaster is an example of this type of printer.
  151. PCC_MULTI_PASS    EQU    $10    ;see explanation above
  152.  
  153.  STRUCTURE  PrinterExtendedData,0
  154.     APTR    ped_PrinterName   ; printer name, null terminated
  155.     APTR    ped_Init          ; called after LoadSeg
  156.     APTR    ped_Expunge       ; called before UnLoadSeg
  157.     APTR    ped_Open          ; called at OpenDevice
  158.     APTR    ped_Close         ; called at CloseDevice
  159.     UBYTE   ped_PrinterClass  ; printer class
  160.     UBYTE   ped_ColorClass    ; color class
  161.     UBYTE   ped_MaxColumns    ; number of print columns available
  162.     UBYTE   ped_NumCharSets   ; number of character sets
  163.     UWORD   ped_NumRows       ; number of 'pins' in print head
  164.     ULONG   ped_MaxXDots      ; number of dots maximum in a raster dump
  165.     ULONG   ped_MaxYDots      ; number of dots maximum in a raster dump
  166.     UWORD   ped_XDotsInch     ; horizontal dot density
  167.     UWORD   ped_YDotsInch     ; vertical dot density
  168.     APTR    ped_Commands      ; printer text command table
  169.     APTR    ped_DoSpecial     ; special command handler
  170.     APTR    ped_Render        ; raster render function
  171.     LONG    ped_TimeoutSecs   ; good write timeout
  172. ;------    the following only exists if the segment version is 33 or greater
  173.     APTR     ped_8BitChars    ;conversion strings for the extended font
  174.     LONG     ped_PrintMode    ;set if text printed, otherwise 0
  175. ;------    the following only exists if the segment version is 34 or greater
  176.     APTR    ped_ConvFunv    ; ptr to conversion function for all chars
  177. ;------    the following only exists if the segment version is 44 or greater
  178. ;       and PPCF_EXTENDED is set.
  179.     APTR     ped_TagList
  180.     APTR     ped_DoPreferences
  181.     APTR     ped_CallErrHook
  182.     LABEL   ped_SIZEOF
  183.  
  184. PRTA_Dummy        EQU    TAG_USER + $50000
  185.  
  186. PRTA_8BitGuns        EQU    PRTA_Dummy + 1
  187. PRTA_ConvertSource    EQU    PRTA_Dummy + 2
  188. PRTA_FloydDithering    EQU    PRTA_Dummy + 3
  189. PRTA_AntiAlias        EQU    PRTA_Dummy + 4
  190. PRTA_ColorCorrection    EQU    PRTA_Dummy + 5
  191. PRTA_NoIO        EQU    PRTA_Dummy + 6
  192. PRTA_NewColor        EQU    PRTA_Dummy + 7
  193. PRTA_ColorSize        EQU    PRTA_Dummy + 8
  194. PRTA_NoScaling        EQU    PRTA_Dummy + 9
  195.  
  196. PRTA_DitherNames    EQU    PRTA_Dummy + 20
  197. PRTA_ShadingNames    EQU    PRTA_Dummy + 21
  198. PRTA_ColorCorrect    EQU    PRTA_Dummy + 22
  199. PRTA_DensityInfo    EQU    PRTA_Dummy + 23
  200.  
  201. PRTA_LeftBorder        EQU    PRTA_Dummy + 30
  202. PRTA_TopBorder        EQU    PRTA_Dummy + 31
  203. PRTA_MixBWColor        EQU    PRTA_Dummy + 32
  204.  
  205. PRTA_Preferences    EQU    PRTA_Dummy + 40
  206.  
  207.  STRUCTURE  PrinterSegment,0
  208.     ULONG   ps_NextSegment    ; (actually a BPTR)
  209.     ULONG   ps_runAlert       ; MOVEQ #0,D0 : RTS
  210.     UWORD   ps_Version        ; segment version
  211.     UWORD   ps_Revision       ; segment revision
  212.     LABEL   ps_PED            ; printer extended data
  213.  
  214.  STRUCTURE  PrtDriverPreferences,0
  215.     UWORD   pdp_Version
  216.     STRUCT  pdp_PrinterID,32
  217.     UBYTE   pdp_PrefName,FILENAME_SIZE-16
  218.     ULONG   pdp_Length
  219.     LABEL   pdp_SIZEOF
  220.  
  221.    ENDC
  222.